using Microsoft.EntityFrameworkCore;

namespace ef_core_2025_learn.Entity;

public class Address
{
    public Guid Id { get; set; }

    /// <summary>
    /// 国家
    /// </summary>
    public string? Country { get; set; }

    /// <summary>
    /// 城市
    /// </summary>
    public required string City { get; set; }

    /// <summary>
    /// 接到
    /// </summary>
    public string? Street { get; set; }

    /// <summary>
    /// 邮政编码
    /// </summary>
    public string? PostalCode { get; set; }

    public Guid UserId { get; set; }
    public User User { get; set; }

   public Coordinate Coordinate { get; set; }
}

[Owned]
public class Coordinate
{
    public double Latitude { get; set; }
    public double Longitude { get; set; }
}